<!-- 财务结构 -->
<template>
  <div>
    <!-- 财务结构  非银行金融 -->
    <div class="table w1021 flex" v-if="isBank=='noBank'">
      <div class="tableTh tableTr flex wrap w220 right">
        <span class="tableTd tanbleTitle">利润表(百万元)</span>
        <span class="tableTd top">营业收入</span>
        <span class="tableTd top">手续费及佣金净收入</span>
        <span class="tableTd top">代理买卖证券业务净收入</span>
        <span class="tableTd top">证券承销业务净收入</span>
        <span class="tableTd top high">
          受托客户资
          <br />产管理业务净收入
        </span>
        <span class="tableTd top">利息净收入</span>
        <span class="tableTd top">投资收益</span>
        <span class="tableTd top high">
          其中:对联营企
          <br />业和合营企业的投资收益
        </span>
        <span class="tableTd top">公允价值变动收益</span>
        <span class="tableTd top">汇兑收益</span>
        <span class="tableTd top">其他业务收入</span>
        <span class="tableTd top">营业支出</span>
        <span class="tableTd top">营业税金及附加</span>
        <span class="tableTd top">管理费用</span>
        <span class="tableTd top">资产减值损失</span>
        <span class="tableTd top">其他业务成本</span>
        <span class="tableTd top">营业利润</span>
        <span class="tableTd top">加:营业外收入</span>
        <span class="tableTd top">减:营业外支出</span>
        <span class="tableTd top">利润总额</span>
        <span class="tableTd top">净利润</span>
        <span class="tableTd top">减:少数股东损益</span>
        <span class="tableTd top high">
          归属于母公司
          <br />所有者的净利润
        </span>
      </div>
      <div class="tableTr tableBody flex">
        <div
          class="flex wrap w175"
          :class="{left:index!=0}"
          v-for="(item,index) in data"
          :key="index"
        >
          <span class="tableTd flex wrap">
            <span class="tableTdd w175 bottom">{{item.reportDate}}</span>
            <span class="tableTdd w70 right">金额</span>
            <span class="tableTdd w70">占比(%)</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingRevenue|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingRevenue|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netCommissionIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netCommissionIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netProxySecuIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netProxySecuIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netSubissueSecuIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netSubissueSecuIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.netTrustIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netTrustIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netInterestIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netInterestIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.investProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.investProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.investIncomeAssociates|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.investIncomeAssociates|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.fairValueChangeProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.fairValueChangeProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.exchangeIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.exchangeIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.otherOperatingIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.otherOperatingIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatinegTaxSurchargs|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatinegTaxSurchargs|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.administrationExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.administrationExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.assetImpairmentLoss|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.assetImpairmentLoss|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.otherOperatingCost|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.otherOperatingCost|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.totalProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.totalProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.minorityProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.minorityProfit|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.npParentCompanyOwners|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.npParentCompanyOwners|filterBFB(item)}}</span>
          </span>
        </div>
      </div>
    </div>
    <!-- 财务结构  非金融 -->
    <div class="table w1021 flex" v-if="isBank=='general'">
      <div class="tableTh tableTr flex wrap w220 right">
        <span class="tableTd tanbleTitle">利润表(百万元)</span>
        <span class="tableTd top">营业收入</span>
        <span class="tableTd top">营业成本</span>
        <span class="tableTd top">营业税金及附加</span>
        <span class="tableTd top">期间费用</span>
        <span class="tableTd top">销售费用</span>
        <span class="tableTd top">财务费用</span>
        <span class="tableTd top">管理费用</span>
        <span class="tableTd top">资产减值损失</span>
        <span class="tableTd top">公允价值变动收益</span>
        <span class="tableTd top">投资收益</span>
        <span class="tableTd top">营业利润</span>
        <span class="tableTd top">营业外收入</span>
        <span class="tableTd top">补贴收入</span>
        <span class="tableTd top">营业外支出</span>
        <span class="tableTd top">利润总额</span>
        <span class="tableTd top">所得税</span>
        <span class="tableTd top high">
          归属于母公
          <br />司所有者的净利润
        </span>
      </div>
      <div class="tableTr tableBody flex">
        <div
          class="flex wrap w175"
          :class="{left:index!=0}"
          v-for="(item,index) in data"
          :key="index"
        >
          <span class="tableTd flex wrap">
            <span class="tableTdd w175 bottom">{{item.reportDate}}</span>
            <span class="tableTdd w70 right">金额</span>
            <span class="tableTdd w70">占比(%)</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingRevenue|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingRevenue|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingCost|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingCost|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatinegTaxSurchargs|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatinegTaxSurchargs|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.periodCost|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.periodCost|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.financialExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.financialExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.administrationExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.administrationExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.assetImpairmentLoss|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.assetImpairmentLoss|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.fairValueChangeProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.fairValueChangeProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.investProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.investProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.subsidyIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.subsidyIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.totalProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.totalProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.incomeTaxCost|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.incomeTaxCost|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.npParentCompanyOwners|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.npParentCompanyOwners|filterBFB(item)}}</span>
          </span>
        </div>
      </div>
    </div>
    <!-- 财务结构  银行 -->
    <div class="table w1021 flex" v-if="isBank=='bank'">
      <div class="tableTh tableTr flex wrap w220 right">
        <span class="tableTd tanbleTitle">利润表(百万元)</span>
        <span class="tableTd top">营业收入</span>
        <span class="tableTd top">利息收入</span>
        <span class="tableTd top">减:利息支出</span>
        <span class="tableTd top">利息净收入</span>
        <span class="tableTd top">手续费及佣金收入</span>
        <span class="tableTd top">减:手续费及佣金支出</span>
        <span class="tableTd top">手续费及佣金净收入</span>
        <span class="tableTd top">投资收益</span>
        <span class="tableTd top high">
          其中:对联营企业
          <br />和合营企业的投资收益
        </span>
        <span class="tableTd top">公允价值变动收益</span>
        <span class="tableTd top">汇兑收益</span>
        <span class="tableTd top">其他业务收入</span>
        <span class="tableTd top">营业支出</span>
        <span class="tableTd top">营业税金及附加</span>
        <span class="tableTd top">管理费用</span>
        <span class="tableTd top">资产减值损失</span>
        <span class="tableTd top">其他业务成本</span>
        <span class="tableTd top">营业利润</span>
        <span class="tableTd top">加:营业外收入</span>
        <span class="tableTd top">减:营业外支出</span>
        <span class="tableTd top">利润总额</span>
        <span class="tableTd top">净利润</span>
        <span class="tableTd top">少数股东损益</span>
        <span class="tableTd top high">
          归属于母公
          <br />司所有者的净利润
        </span>
      </div>
      <div class="tableTr tableBody flex">
        <div
          class="flex wrap w175"
          :class="{left:index!=0}"
          v-for="(item,index) in data"
          :key="index"
        >
          <span class="tableTd flex wrap">
            <span class="tableTdd w175 bottom">{{item.reportDate}}</span>
            <span class="tableTdd w70 right">金额</span>
            <span class="tableTdd w70">占比(%)</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingRevenue|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingRevenue|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.interestIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.interestIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.interestExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.interestExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netInterestIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netInterestIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.commissionIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.commissionIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.commissionExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.commissionExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netCommissionIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netCommissionIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.investProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.investProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.investIncomeAssociates|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.investIncomeAssociates|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.fairValueChangeProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.fairValueChangeProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.exchangeIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.exchangeIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.otherOperatingIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.otherOperatingIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatinegTaxSurchargs|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatinegTaxSurchargs|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.administrationExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.administrationExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.assetImpairmentLoss|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.assetImpairmentLoss|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.otherOperatingCost|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.otherOperatingCost|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.operatingProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.operatingProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingIncome|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingIncome|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.nonOperatingExpense|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.nonOperatingExpense|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.totalProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.totalProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.netProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.netProfit|filterBFB(item)}}</span>
          </span>
          <span class="orange tableTd top flex wrap">
            <span class="tableTdd w70 right">{{item.minorityProfit|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.minorityProfit|filterBFB(item,"minus")}}</span>
          </span>
          <span class="orange tableTd top flex wrap middle">
            <span class="tableTdd w70 right">{{item.npParentCompanyOwners|filterVal("number")}}</span>
            <span class="tableTdd w70">{{item.npParentCompanyOwners|filterBFB(item)}}</span>
          </span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { numberNo, number } from "../../script/api";
export default {
  data() {
    return {};
  },
  props: ["data", "isBank"],
  filters: {
    filterVal(ops, num) {
      if (num == "numberNo") {
        return numberNo(ops, num);
      }
      if (num == "number") {
        return number(ops, num, 1000000);
      }
      if (num == "num") {
        return number(ops, num, 10000);
      }
      return ops ? ops : "0.00";
    },
    filterBFB(ops, bfb, minus) {
      if (!ops) {
        return "--";
      }
      if (minus) {
        const val = numberNo((ops / bfb.operatingRevenue) * 100, "numberNo");
        return val > 0 ? -val : val;
      }
      return numberNo((ops / bfb.operatingRevenue) * 100, "numberNo");
    }
  },
  components: {},
  computed: {},
  mounted() {},
  methods: {}
};
</script>
<style lang='scss' scoped>
</style>